import java.util.Scanner;

/*
      封装方法求算结果
 */
public class MothodDemo08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //建立输入
        System.out.println("请输入第一个数:");
        double num1 = sc.nextInt();
        System.out.println("请输入第二个数:");
        double num2 = sc.nextInt();
        System.out.println("和是:" + sum(num1, num2));
        System.out.println("是否相等" + compare(num1, num2));
        double[] maxAndMin = getMaxAndMin(num1,num2);
        System.out.println("最大值是" +maxAndMin[0] );
        System.out.println("最小值是" +maxAndMin[1] );

    }

    //方法一 数据之和
    public static double sum(double num1, double num2) {
        double sum = num1 + num2;
        return sum;
    }

    //方法二  判断相等
    public static boolean compare(double num1, double num2) {
        if (num1 == num2) {
            return true;
        } else {
            return false;
        }
    }

    //方法三  判断大小
    public static double[] getMaxAndMin(double num1, double num2) {
        double max = 0;
        double min = 0;
        if (num1 > num2) {
            max = num1;
            min = num2;
        } else {
            max = num2;
            min = num1;
        }
        double[] getMaxAndMin={max,min};
        return getMaxAndMin;
    }
}

